package common.config;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Common on 16/1/7.
 */
public class IndexTypeNames {

    public enum ESType {VIDEO, PROGRAM, SEQUENCE, SCENE,SHOT};

    public static String[] ES_TYPES = {
            MediaDB.FileSetName, MediaDB.ProgramSetName, MediaDB.SequenceSetName,
            MediaDB.SceneSetName, MediaDB.ShotSetName
    };



    /*
    * 1 Video Databse
     */
    public static class MediaDB {

        public static final String IndexName = "media";
        //public static String FileSetName = "test0";
        public static final String FileSetName = "video";
        //public static String ProgramSetName = "programColletion";
        public static final String ProgramSetName = "program";
        //public static String SequenceSetName = "sequenceCollection";
        public static final String SequenceSetName = "sequence";
        //public static String SceneSetName = "sceneCollection";
        public static final String SceneSetName = "scene";
        //public static String ShotSetName = "shotCollection";
        public static final String ShotSetName = "shot";

        /****************************
         *
         * @return
         */
        public static String getIndexName(){
            return IndexName;
        }

        public static String[] getTypeNames(){
            String[] ret = {ProgramSetName,SequenceSetName,SceneSetName,ShotSetName};
            return ret;
        }

        public static String getVideoTypeName(){
            return FileSetName;
        }

        public static String[] getTableTypeNames(){
            String[] ret = {ProgramSetName,SequenceSetName,SceneSetName,ShotSetName};
            return ret;
        }
        public static List<String> getTableTypeList(){
            List<String> levels = new ArrayList<String>();
            levels.add(MediaDB.ProgramSetName);
            levels.add(MediaDB.SequenceSetName);
            levels.add(MediaDB.SceneSetName);
            levels.add(MediaDB.ShotSetName);
            return levels;
        }


        public static String getTypeNameByType(ESType type){
            int idx = type.ordinal();
            return ES_TYPES[idx];
        }
    }
}
